package com.cetc39.bean;

import java.util.HashSet;
import java.util.Set;

import javax.persistence.CascadeType;
import javax.persistence.Entity;
import javax.persistence.FetchType;
import javax.persistence.GeneratedValue;
import javax.persistence.Id;
import javax.persistence.JoinTable;
import javax.persistence.ManyToMany;
import javax.persistence.Table;


@Entity
@Table(name="t_subcycle")
public class Subcycle {
	private int id;
	private int id_subcycle;
	private String name_subcycle;
	private Set<Project> projects = new HashSet<Project>(0);
	
	@Id
	@GeneratedValue
	public int getId() {
		return id;
	}
	public void setId(int id) {
		this.id = id;
	}
	public int getId_subcycle() {
		return id_subcycle;
	}
	public void setId_subcycle(int id_subcycle) {
		this.id_subcycle = id_subcycle;
	}
	public String getName_subcycle() {
		return name_subcycle;
	}
	public void setName_subcycle(String name_subcycle) {
		this.name_subcycle = name_subcycle;
	}
	
	@ManyToMany(fetch=FetchType.LAZY, mappedBy="subcycles")
	public Set<Project> getProjects() {
		return projects;
	}
	public void setProjects(Set<Project> projects) {
		this.projects = projects;
	}
	
}
